package com.viqiang.ye.exception;

import com.viqiang.ye.api.IErrorCode;

/**
 *自定义API异常
 */
public class ApiException extends RuntimeException {
    private IErrorCode errorCode;

    public ApiException(IErrorCode errorCode) {
        super(errorCode.getMessage());
        errorCode = errorCode;
    }

    public ApiException(String message) {
        super(message);
    }

    public ApiException(Throwable throwable){
        super(throwable);
    }

    public ApiException(String message, Throwable throwable) {
        super(message, throwable);
    }

    public IErrorCode getErrorCode() {
        return errorCode;
    }
}
